<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$time_id=$_POST[time_id];
$time=$_POST[time];
$sql="insert into time(time_id,time) values('$time_id','$time')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=time.php'>";
}
if($_GET[MODE]=="DEL")
{
$time_id=$_GET[time_id];
$time=$_GET[time];
$sql="delete from time where time_id='$time_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=time.php'>";
}
if($_POST[MODE]=="EDIT")
{
$time_id=$_POST[time_id];
$time=$_POST[time];
$sql="UPDATE time set time_id='$time_id',time='$time' where time_id='$time_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=time.php'>";
}
?>